﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="test._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Constream Web Manager v0.14</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:SqlDataSource ID="SqlDataSourceOPREF" runat="server" 
            ConnectionString="<%$ ConnectionStrings:connOPREF %>" 
            ProviderName="<%$ ConnectionStrings:connOPREF.ProviderName %>" 
            SelectCommand="SELECT * FROM operator_ref"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSourceVOCA" runat="server" 
            ConnectionString="<%$ ConnectionStrings:connVOCA %>" 
            ProviderName="<%$ ConnectionStrings:connVOCA.ProviderName %>" 
            SelectCommand="SELECT * FROM vocabulary"></asp:SqlDataSource>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                Vocabulary Name<br />
                <asp:TextBox ID="TextBoxVOCA" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="TextBoxVOCA" 
                    ErrorMessage="Require to fill out non-empty string"></asp:RequiredFieldValidator>
                <br />
                <table border="2" style="width: 98%;">
                    <tr>
                        <td>
                            Operator List</td>
                        <td>
                            Sensor / Device List</td>
                        <td>
                            Parameters</td>
                        <td>
                            Frequency</td>
                        <td>
                            Action</td>
                    </tr>
                    <tr>
                        <td rowspan="2">
                            <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
                                DataSourceID="SqlDataSourceOPREF" DataTextField="OP_NAME" 
                                DataValueField="OP_NAME" 
                                onselectedindexchanged="DropDownList1_SelectedIndexChanged">
                            </asp:DropDownList>
                        </td>
                        <td rowspan="2">
                            <asp:DropDownList ID="DropDownList2" runat="server" 
                                onselectedindexchanged="DropDownList2_SelectedIndexChanged">
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:Label ID="LabelCon1" runat="server" Text="Label" Visible="False"></asp:Label>
                            <asp:TextBox ID="TextBoxCon1" runat="server" Height="16px" Visible="False" 
                                Width="99px"></asp:TextBox>
                            <br />
                            <asp:DropDownList ID="DropDownList3" runat="server" Visible="False">
                            </asp:DropDownList>
                        </td>
                        <td rowspan="2">
                            <asp:TextBox ID="TextBoxFreq" runat="server" Height="16px" Width="68px"></asp:TextBox>
                            <br />
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                ControlToValidate="TextBoxFreq" ErrorMessage="Required to fill out a Real Number" 
                                ValidationExpression="^[0-9]+(.[0-9]+)?$"></asp:RegularExpressionValidator>
                            <br />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                ControlToValidate="TextBoxFreq" 
                                ErrorMessage="Required to fill out a Real Number"></asp:RequiredFieldValidator>
                        </td>
                        <td rowspan="2">
                            <asp:Button ID="ButtonADD" runat="server" onclick="ButtonADD_Click" 
                                Text="ADD" />
                            &nbsp;<asp:Button ID="ButtonEDIT" runat="server" onclick="ButtonEDIT_Click" 
                                Text="EDIT" />
                            <asp:Button ID="ButtonDELETE" runat="server" onclick="ButtonDELETE_Click" 
                                Text="DELETE" />
                            <asp:Button ID="ButtonRESET" runat="server" onclick="ButtonRESET_Click" 
                                Text="RESET" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="LabelCon2" runat="server" Text="Label" Visible="False"></asp:Label>
                            <asp:TextBox ID="TextBoxCon2" runat="server" Height="16px" Visible="False" 
                                Width="99px"></asp:TextBox>
                            <br />
                            <asp:DropDownList ID="DropDownList4" runat="server" Visible="False">
                            </asp:DropDownList>
                        </td>
                    </tr>
                </table>
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
                <br />
                Vocabulary View<br />
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE" 
                    BorderStyle="None" BorderWidth="1px" CellPadding="4" 
                    DataKeyNames="VOCA_NAME,OP_NAME,SENS_DEV_ID,THRESHOLD_NAME1,THRESHOLD_NAME2,FREQUENCY" 
                    DataSourceID="SqlDataSourceVOCA" ForeColor="Black" GridLines="Vertical" 
                    onselectedindexchanged="GridView1_SelectedIndexChanged">
                    <RowStyle BackColor="#F7F7DE" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" />
                        <asp:BoundField DataField="VOCA_NAME" HeaderText="Vocabulary Name" 
                            ReadOnly="True" SortExpression="VOCA_NAME" />
                        <asp:BoundField DataField="OP_NAME" HeaderText="OP_NAME" ReadOnly="True" 
                            SortExpression="OP_NAME" />
                        <asp:BoundField DataField="SENS_DEV_ID" HeaderText="SENS_DEV_ID" 
                            ReadOnly="True" SortExpression="SENS_DEV_ID" />
                        <asp:BoundField DataField="THRESHOLD_NAME1" HeaderText="THRESHOLD_NAME1" 
                            ReadOnly="True" SortExpression="THRESHOLD_NAME1" />
                        <asp:BoundField DataField="THRESHOLD_NAME2" HeaderText="THRESHOLD_NAME2" 
                            ReadOnly="True" SortExpression="THRESHOLD_NAME2" />
                        <asp:BoundField DataField="FREQUENCY" HeaderText="FREQUENCY" ReadOnly="True" 
                            SortExpression="FREQUENCY" />
                        <asp:BoundField DataField="SEQ" HeaderText="SEQ" InsertVisible="False" 
                            SortExpression="SEQ" />
                    </Columns>
                    <FooterStyle BackColor="#CCCC99" />
                    <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                    <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
                <br />
                <br />
                
            </ContentTemplate>
        </asp:UpdatePanel>
        <br />
        <br />
        <br />
        <br />
    
    </div>
    </form>
</body>
</html>
